namespace CSharpPro._0925;

public class Dome
{
    //属性
    //int price = int.Parse(Console.ReadLine());
    
    //方法
    public void TextPrint()
    {
        Console.WriteLine();
        int num = 123;
        //读取数值
        int num2 = Convert.ToInt32(Console.ReadLine());
        //百位数
        Console.WriteLine(num2 / 100);
        //十位数
        Console.WriteLine(num2 / 10 % 10);
        //个位数
        Console.WriteLine(num2 % 10);
    }


    //作业1
    public void TextPrint1()
    {
        int year;
        String input;
        Console.WriteLine("请输入一个年数:");
        input = Console.ReadLine();
        year = int.Parse(input);
        bool i = false;
        if (year % 4 == 0)
        {
            if (year % 100 == 0)
            {
                if (year % 400 == 0)
                {
                    i = true;
                }
                else
                {
                    i = false;
                }
            }
            else
            {
                i = false;
            }
        }
        else
        {
            i = false;
        }

        if (i)
        {
            Console.WriteLine("是闰年");
        }
        else
        {
            Console.WriteLine("不是闰年");
        }

    }



    //作业2
    public void TextPrint2()
    {
        Console.WriteLine("请输入购票价格:");
        int price = int.Parse(Console.ReadLine());
        double count;
        double sum;
        if(price >= 100 )
        {
            count = 0.9;
            sum = price * count;
        }
        else if (price >= 500)
        {
            count = 0.75;
            sum = price * count;
        }
        else
        {
            sum = price;
        }

        Console.WriteLine(sum);

    }
}